﻿using System;
using System.Web.Mvc;
using FluentNHibernate.Conventions;

namespace BoneSystem.Models
{
    public class CadastroRestModel
    {
        public Type ClassType { get; set; }
        public string FormName { get; set; }
        public string DialogName { get; set; }
        public string RibbonName { get; set; }
        public MvcHtmlString PartialForm { get; set; }
        public string DialogTitle { get; set; }
        public string ControllerName { get; set; }
        public string Area { get; set; }
        public string UrlNew
        {
            get
            {
                if (Area.IsNotEmpty())
                {
                    return "/" + Area + "/" + ControllerName + "/New";
                }
                return "/" + ControllerName + "/New";
            }
        } 
        public string UrlDelete
        {
            get
            {
                if (Area.IsNotEmpty())
                {
                    return "/" + Area + "/" + ControllerName + "/Delete";
                }
                return "/" + ControllerName + "/Delete";
            }
        }
        public string UrlLoadPartialView
        {
            get
            {
                if (Area.IsNotEmpty())
                {
                    return "/" + Area + "/" + ControllerName + "/LoadPartialView";
                }
                return "/" + ControllerName + "/LoadPartialView";
            }
        }
        public string UrlLoadPopup
        {
            get
            {
                if (Area.IsNotEmpty())
                {
                    return "/" + Area + "/" + ControllerName + "/LoadPopup";
                }
                return "/" + ControllerName + "/LoadPopup";
            }
        }

        public string UrlList
        {
            get
            {

                return "/AutoCompleteData/" + ControllerName + "AutoCompleteData";
            }
        }
        public string UrlEdit
        {
            get
            {
                if (Area.IsNotEmpty())
                {
                    return "/" + Area + "/" + ControllerName + "/Get";
                }
                return "/" + ControllerName + "/Get";
            }
        }
        public string UrlSave
        {
            get
            {
                if (Area.IsNotEmpty())
                {
                    return "/" + Area + "/" + ControllerName + "/Save";
                }
                return "/" + ControllerName + "/Save";
            }
        }

        public int DialogWidth { get; set; }
        public int DialogHeigth { get; set; }
    }
}